home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / userutl.h < prev    next >
Text File  |  1993-08-23  |  8KB  |  222 lines

  1. /* Dec 1990 (userutl.h)  Version 4.00 */
  2.  
  3. /************************************************************************
  4.  * Copyright(C) 1987-1992 NeuralWare Inc                                *
  5.  * Penn Center West, IV-227, Pittsburgh, PA 15276                       *
  6.  * Telephone: (412) 787-8222    FAX: (412) 787-8220                     *
  7.  *                                                                      *
  8.  * All rights reserved.  No part of this program may be reproduced,     *
  9.  * stored in a retrieval system, or transmitted, in any form or by any  *
  10.  * means, electronic, mechanical, photocopying, recording or otherwise  *
  11.  * without the prior written permission of the copyright owner,         *
  12.  * NeuralWare, Inc.                                                     *
  13.  *                                                                      *
  14.  *                          PROPRIETARY NOTICE                          *
  15.  *                                                                      *
  16.  * This document is the property of NeuralWare, Inc. and contains       *
  17.  * trade-secrets and other proprietary information.  The information    *
  18.  * herein is reserved as proprietary to NeuralWare, and is not to be    *
  19.  * published, reproduced, copied, disclosed, used, or reverse           *
  20.  * engineered without the express written consent of a duly authorized  *
  21.  * representative of NeuralWare.                                        *
  22.  ************************************************************************
  23.  */
  24.  
  25. #include "host.h"
  26.  
  27. #ifdef __ZTC__
  28. #ifndef DLC
  29. #define DLC 1
  30. #endif
  31. #endif
  32.  
  33. #ifdef THINK_C  /* No command line for Think C */
  34. #ifndef MAC
  35. #define MAC 1
  36. #endif
  37. #include <stdio.h>
  38. #endif
  39.  
  40. #ifdef MAC
  41. #undef  UNIX
  42. #endif
  43.  
  44. #ifdef DLC
  45. #undef  UNIX
  46. #endif
  47.  
  48. #ifdef XTM
  49. struct sem {
  50.    int semval;
  51. };
  52. struct sembuf{
  53.    int sem_num;
  54.    int sem_op;
  55.    int sem_flg;
  56. };
  57. #endif
  58.  
  59. #ifdef  UNIX
  60. #if defined(PS2AIX) || defined(RS6) || defined(XTM) /* || defined(HP700) */
  61.  
  62. #define    SEMTYPE    struct sem
  63.  
  64. #else
  65.  
  66. #if defined(EWS) || defined(VAXULT) || defined(HP700) || defined(SOLARIS)
  67. typedef union {
  68.    int              val;
  69.    struct semid_ds *buf;
  70.    ushort          *array;
  71. } SEMTYPE;
  72.  
  73. #define semval  val   /* for "arg.val" */
  74.  
  75. #else
  76. #define    SEMTYPE    union semun
  77. #define semval  val   /* for "arg.val" */
  78. #endif
  79.  
  80. #endif
  81.  
  82. #endif  /* UNIX */
  83.  
  84. #if defined(THINK_C)
  85. #define NEW_LINE    ((int)'\r')
  86. #define NEW_LINE_STR  "\r"
  87. #else /* THINK_C */
  88. #define NEW_LINE    ((int)'\n')
  89. #define NEW_LINE_STR  "\n"
  90. #endif /* THINK_C */
  91.  
  92. /* Compatibility codes for switch statement version of UserIO */
  93. #define RQ_LEARNIN      1        /* training input */
  94. #define RQ_LEARNOUT     2        /* training desired output */
  95. #define RQ_LEARNRSLT    6        /* training result */
  96. #define RQ_READ         3        /* operational input */
  97. #define RQ_WRITE        4        /* operational output */
  98. #define RQ_WRSTEP      10        /* interim output (Hopfield/BAM) */
  99. #define RQ_LSTART       7        /* start learning */
  100. #define RQ_RSTART       8        /* start recall */
  101. #define RQ_LEND        14        /* end learning */
  102. #define RQ_REND        15        /* end recall */
  103. #define RQ_TERM         5        /* terminate */
  104. #define RQ_ATTENTION    9        /* unsolicited request for attention */
  105. #define RQ_REWIND      11        /* rewind input file */
  106. #define RQ_INSTRUM     13        /* output data from instrument */
  107. #define RQ_RCLTST      16        /* Recall Test */
  108. #define RQ_EXPLAIN     17        /* Explain output */
  109. #define RQ_OBJFUNC     19        /* Objective function */
  110.  
  111. /* the following definitions are for requests to NeuralWorks */
  112.  
  113. #define UGX_DATA         0  /* responded to data */
  114. #define UGX_GETDS        1  /* get a string from dialog area */
  115. #define UGX_PUTDS        2  /* put a string to dialog area */
  116. #define UGX_SAVENET      3  /* save the network */
  117. #define UGX_GRPARM       4  /* get x-size, y-size, ncolors */
  118. #define UGX_CLEAR        5  /* clear a window's contents */
  119. #define UGX_DELETE       6  /* delete a window */
  120. #define UGX_WINDOW       7  /* set up a window */
  121. #define UGX_LINE         8  /* draw a line */
  122. #define UGX_POINT        9  /* draw a point */
  123. #define UGX_BOX         10  /* draw an outline box */
  124. #define UGX_BOXF        11  /* draw a filled box */
  125. #define UGX_PUTS        12  /* put a string in a window */
  126. #define UGX_MOUSE       13  /* read mouse position / buttons */
  127. #define UGX_RDPOINT     14  /* read a point */
  128. #define UGX_RDNETINF    15  /* read network info */
  129. #define UGX_GETINSTRT   16  /* Get instrument title */
  130. #define UGX_CIRCLE      29  /* draw a circle */
  131.  
  132. /* the following are ONLY for requests from user control routines */
  133.  
  134. #define UGX_LOADNET     17  /* load a network */
  135. #define UGX_LEARN       18  /* learn */
  136. #define UGX_RECALL      19  /* recall */
  137. #define UGX_MSGIO       20  /* message I/O */
  138.  
  139. /* Additional features for accessing network data */
  140.  
  141. #define UGX_PEIO        25  /* PE read/write */
  142. #define UGX_SCHDIO      26  /* L/R Schedule R/W */
  143. #define UGX_CTRIO       27  /* Super-Layer Ctrs R/W */
  144. #define UGX_CNIO        28  /* Connection R/W */
  145.  
  146. /* The following codes are for faster graphics where fewer context 
  147.    switches are needed */
  148.  
  149. #define UGX_BLIT        21  /* blit an array to the screen*/
  150. #define UGX_PBLIT       24  /* blit a single-color pattern to scrn */
  151.  
  152. /* New features added for Pruning */
  153.  
  154. #define UGX_WTSTATS     22  /* weight statistics */
  155. #define UGX_PRUNE       23  /* prune network */
  156.  
  157. #ifndef NPHIST
  158. #define NPHIST  100   /* # of items in histogram */
  159. #endif
  160.  
  161. /* mouse button bit definitions for "ug_mouse" */
  162.  
  163. #define MBUT_RIGHT      0x04  /* right mouse button */
  164. #define MBUT_MIDDLE     0x02  /* middle mouse button */
  165. #define MBUT_LEFT       0x01  /* left mouse button */
  166.  
  167. /************************************************************************
  168.  *                                                                      *
  169.  *    Graphics menu interface header file                               *
  170.  *                                                                      *
  171.  ************************************************************************
  172.  These structures and defines are included for convience as part of the
  173.  graphics interface used by several of the User I/O examples.  They are
  174.  not necessary to the operation of the program.
  175.  
  176.  The GMENU structure defines the basic parameters for a menu.  Menu
  177.  items (which go ACROSS the screen) are defined in an array of
  178.  GMENU_ITEM structures.
  179.  */
  180.  
  181. typedef struct {  /* Graphics menu item */
  182.    int      code;          /* menu item code */
  183.    char    *text;          /* line of text for menu item */
  184.    char    *text2;         /* auxillary line of text for menu item */
  185.    int      flag;
  186. #define GM_HILITE   0x0001      /* item highlighted */
  187. #define GM_LOCKED   0x0002      /* item locked */
  188.    int      x0,y0,x1,y1;   /* interior box (for highlighting) */
  189.    int      xt, yt;        /* x,y coords of text */
  190. } GMENU_ITEM;
  191.  
  192.  
  193. typedef struct {  /* Graphics menu - horizontal line of items */
  194.    GMENU_ITEM     *item;           /* pointer to array of items */
  195.    int             num_items;      /* number of menu items */
  196.    int             key;            /* window key */
  197.    int             flag;
  198. #define GM_AUX          0x0001          /* Set if auxillary line of text */
  199.    int             x0, y0;         /* BL of menu relative to window */
  200.    int             x1, y1;         /* TR of menu relative to BL */
  201. } GMENU;
  202.  
  203. #define GM_MARGIN 2   /* text margin in y direction  */
  204.  
  205.  
  206. #ifndef DP_RUN
  207. GLOBALREF NINT      gm_intcolor;    /* interior color */
  208. GLOBALREF NINT      gm_outcolor;    /* outline color */
  209. GLOBALREF NINT      gm_txtcolor;    /* text color */
  210. #endif
  211.  
  212. IMPORT VOID InitGMenu ARGLIST ((GMENU *,int,int ));  /* Initialize a menu */
  213. IMPORT VOID DispGMenu ARGLIST ((GMENU * ));          /* Display menu */
  214. IMPORT VOID DispGItem ARGLIST ((GMENU *,GMENU_ITEM *,int,int )); /* Display menu item */
  215. IMPORT GMENU_ITEM *LookGMenu ARGLIST ((GMENU *, int * ));  /* Look at menu */
  216.  
  217. #ifndef UIO_STRC_H
  218. #include "uio_strc.h"
  219. #endif
  220.  
  221. #include "uio_reqs.pro"
  222.